<template>
  <div class="rank_box">
    <div class="title">
      <p>各大景区排行榜</p>
      <img src="../../images/dataScreen-title.png" alt="" />
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
const charts = ref()
onMounted(() => {
  const myecharts = echarts.init(charts.value)
  myecharts.setOption({
    title: {
      text: '各个专业异常人数',
      show: true,
      left: '40%',
      textStyle: {
        color: 'orange',
      },
      // subtext:'各大景区排行',
      // subtextStyle:{
      //   color:'orange',
      //   fontSize:'20'
      // }
    },
    xAxis: {
      type: 'category',
    },
    yAxis: {
      splitLine: {
        show: false,
      },
      // splitLine: {
      //   show: false,
      // },
      //     //轴线的设置
      //     axisLine: {
      //   show: false,
      // },
    },
    grid: {
      left: 30,
      bottom: 30,
      right: 0,
    },
    series: [
      {
        type: 'bar',
        data: [10, 20, 30, 40, 50, 60, 70],
        label: {
          show: true,
          position: 'top',
          color: 'orange',
        },
      },
    ],
  })
})
</script>

<style scoped lang="scss">
.rank_box {
  width: 100%;
  height: 100px;
  background: url(../../images/dataScreen-main-cb.png) no-repeat;
  background-size: 100% 100%;
  .title {
    margin: 20px 1px;
    p {
      color: white;
    }
  }
  .charts {
    height: calc(100% - 80px);
  }
}
</style>
s
